Nevron Open Vision Documentation
Framework / Layouts / Dock Layout
In This Topic
    Dock Layout
    In This Topic

    The dock layout is a box layout that place the boxes sequentially in one of five dock areas. It is implemented by the NDockLayout class.

     Dock Areas

    The dock areas are defined by the ENDockArea enumeration:

    ENDockArea Description
    Left The cell is docked to the current left area and fills the available space in vertical direction.
    Right The cell is docked to the current right area and fills the available space in vertical direction.
    Top The cell is docked to the current top area and fills the available space in horizontal direction.
    Bottom The cell is docked to the current bottom area and fills the available space in horizontal direction.
    Center The cell is docked to the current center area and fills the available space in both horizontal and vertical direction.

    To set the dock area of a widget, you should use the DockArea extended property of the NDockLayout class:

    Set Dock Area Exampe
    Copy Code
    NDockLayout.SetDockArea(widget, ENDockArea.Left);
    

    The image below demonstrates a dock layout of five differently colored boxes placed in each of the five docking areas:

    Nevron Dock Layout Nevron Dock Layout
    Nevron Dock Layout Nevron Dock Layout - reversed box adding order

    As the image above demonstrates, the order in which the boxes are added to the dock panel is very important, because there are different amounts of horizontal and vertical space left after adding a new box to the dock. The number in brackets denotes the order in which the boxes were added to the dock panel, i.e. the box with number 0 is the first added box, the box with number 1 is the second added box and so on.

     Properties

    The following properties of the dock layout let you control the layout process:

    • HorizontalSpacing - defines the minimal horizontal spacing between the boxes. By default set to 0.
    • VerticalSpacing - defines the minimal vertical spacing between the boxes. By default set to 0.
    • UniformWidths - defines the way in which the boxes are resized in the X dimension prior to being measured or arranged. By default set to None, which means that boxes are initially having their desired widths.
    • UniformHeights - defines the way in which the boxes are resized in the Y dimension prior to being measured or arranged. By default set to None, which means that boxes are initially having their desired heights.
    See Also